window.onload = function(){
    var param = location.search;
    var orderId = param.substring(9);
    var orderIdAft = orderId.split("&")[0];
    var detailId = orderId.split("&")[1].split("=")[1];
    var zongjia = document.querySelector(".p1 i");
    var dingDan = document.querySelector(".p2 i");
    var adress = document.querySelector(".p3 i");
    var content = document.querySelector(".p4 i");
    var token = selectByKey("like_token");
    var foot = document.querySelector("footer");
    //跳页
    Tap(foot,function(){
        window.location.href = "waitOut.html?id="+orderIdAft;
    });
   if(orderId){
       $.ajax({
           url:pathName+"/api/v1/member/cart/122/order",
           type:"GET",
           headers:{
               "Accept":"application/json",
               "Authorization":"Bearer "+token,
           },
           data:{
               "order_id":orderIdAft,
           },
           success:function(data){
               console.log(data);
               data = data.order;
               console.log(data);
               zongjia.innerHTML = data.pay_total;
               var tempArr = data.goodDetail;
               dingDan.innerHTML = data.order_id;
               adress.innerHTML = data.address+'/'+data.name+'/'+data.phone;
               var html = "";
               for(var i = 0; i < tempArr.length; i++){
                   html += tempArr[i].good_name +"×"+tempArr[i].good_num+"、";
               }
               html = html.substring(0,html.length-1);
               content.innerHTML = html;
           }
       });
   }
}